-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VAULTS] Polish Permissions contract and other minor improvements #935
base: feat/vaults
Are you sure you want to change the base?
Conversation
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: fdb7a08 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
* @notice The order of confirmations does not matter | ||
* | ||
*/ | ||
modifier onlyMutuallyConfirmed(bytes32[] memory _roles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's check for the empty _roles
mapping(bytes32 callId => mapping(bytes32 role => uint256 timestamp)) public confirmations; | ||
|
||
/** | ||
* @notice Confirmation lifetime in seconds; after this period, the confirmation expires and no longer counts. | ||
*/ | ||
uint256 public confirmLifetime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be non-linear storage though?
* - role: role that confirmed the action | ||
* - timestamp: timestamp of the confirmation. | ||
*/ | ||
mapping(bytes32 callId => mapping(bytes32 role => uint256 timestamp)) public confirmations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add some getters to make it more accessible?
* the confirmation is considered expired, no longer counts and must be recasted for the confirmation to go through. | ||
* @param _newConfirmLifetime The new confirmation lifetime in seconds. | ||
*/ | ||
function _setConfirmLifetime(uint256 _newConfirmLifetime) internal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can track the last confirmation timestamp and revert this function if new conf precedes it
@@ -97,18 +89,18 @@ contract Dashboard is Permissions { | |||
/** | |||
* @notice Initializes the contract with the default admin role |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated comment (doesn't mention the second parameter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
treasuryFee -> treasuryFeeBP and maybe other similar cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong comment:
/**
* @notice Withdraws stETH tokens from the staking vault to wrapped ether.
* @param _recipient Address of the recipient
* @param _amountOfWETH Amount of WETH to withdraw
*/
function withdrawWETH(address _recipient, uint256 _amountOfWETH) external {
_withdraw(address(this), _amountOfWETH);
WETH.deposit{value: _amountOfWETH}();
SafeERC20.safeTransfer(WETH, _recipient, _amountOfWETH);
}
have similar issues for other utility functions here and there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz consider revamping comment sections
|
||
/** | ||
* @notice Mass-grants multiple roles to multiple accounts. | ||
* @param _assignments An array of role assignments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe note that duplicates wouldn't revert the call rather resulting in fewer events emitted (and cover this behavior with tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe prohibit zero address for NodeOperator
a3c4a13
to
fce5c97
Compare
This PR includes minor improvements to Permissions, some refactoring and improvements